<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>

<head><title><s:text name="edit.user"/></title></head>

<s:head/>

<div class="panel" style="width: 300px">
	<div class="panelTitle"><s:text name="edit.user"/></div>
	
	<s:form theme="eve" validate="true" action="SecurityUpdateUser" method="post" cssErrorClass="current">
		<s:if test='%{userName != null}'>
			<tr>
				<td class="tdLabel"><s:text name="username"/>:</td>
				<td><s:hidden name="user.name"/>${userName}</td>
			</tr>		
		</s:if>
		<s:else>
			<s:textfield name="user.name" required="true" requiredposition="left" labelposition="left" key="username" size="20" maxlength="50"/>
		</s:else>
		
		<s:textfield required="true" requiredposition="left" labelposition="left" key="email" name="user.email"/>
		
		<s:select required="true" listKey="id" listValue="name" requiredposition="left" key="groups" name="groups" value="selectedGroups" list="groups" multiple="true"></s:select>
		<s:checkbox labelposition="left" key="enabled" name="user.enabled"></s:checkbox>
		
		<s:if test='%{userName != null}'>
			<s:password labelposition="left" key="change.password" name="user.password"></s:password>
		</s:if>
		<s:else>
			<s:password required="true" requiredposition="left" labelposition="left" key="password" name="user.password"></s:password>
		</s:else>
		
		<tr><td colspan="2">&nbsp;</td></tr>
		<tr><td colspan="2" align="center">
			<s:submit theme="simple" key="save" />
			<input type="button" value="<s:text name="cancel"/>" onClick="window.location.href='SecurityUsers'"/>
		</td></tr>
	</s:form>
</div>